<?#//v.3.1.2

#//////////////////////////////////////////////////////////////
#//  COPYRIGHT 1999-2007 Phpauction.net ALL RIGHTS RESERVED  //
#//////////////////////////////////////////////////////////////
?>
<TABLE WIDTH="100%" bgcolor="<?=$BGCOLOR?>" BORDER=0 CELLPADDING="0" CELLSPACING="0">
  <TR align="center">
    <TD colspan="2">
<div class="titTable3"><A HREF="item.php?id=<?=$_SESSION['CURRENT_ITEM']?>"><?=$MSG_138?></A></div>
<BR />
<FORM NAME=messageboard ACTION=<?=basename($_SERVER["PHP_SELF"])?> METHOD=POST>
<INPUT TYPE=hidden NAME=todo VALUE="insertmessage" />
<INPUT TYPE=hidden NAME=id VALUE="<?=$id?>" />
<TABLE WIDTH="70%" BORDER="0" CELLSPACING="0" CELLPADDING="6" ALIGN="center">
    <TR>
          <TD WIDTH="79%" VALIGN="top" class=titTable4>
          <?
          if(basename($_SERVER['PHP_SELF']) == 'publicboard.php'){
             print $MSG_30_0167;
          }else{
              print $MSG_30_0169;
         }
         print $_SESSION['CURRENTAUCTIONTITLE'];
        ?>
          </TD>
    </TR>
</TABLE>
    <TABLE WIDTH="70%" BORDER="0" CELLSPACING="0" CELLPADDING="6" ALIGN="center" BGCOLOR="#EEEEEE">
        <TR>
            <TD WIDTH="79%" VALIGN="top" ALIGN=CENTER>
            <?
                if(!isset($HTTP_SESSION_VARS[PHPAUCTION_LOGGED_IN]))
                {
            ?>
                <FONT COLOR=#FF9900 class=errfont><?=$MSG_5056?></FONT><BR />
            <?
                }
            ?>
                <TEXTAREA NAME="newmessage" COLS="60" ROWS="5"></TEXTAREA>
                <BR /><BR />
                <INPUT TYPE="submit" NAME="Submit" VALUE="<?=$MSG_5057?>" class=button />
            </TD>
    </TR>
</TABLE>

<BR />
<BR />
<TABLE WIDTH="70%" BORDER="0" CELLSPACING="0" CELLPADDING="2" ALIGN="center" BGCOLOR="#EEEEEE">
    <TR>
        <TD WIDTH="79%" colspan=2 VALIGN="top" class=titTable4>
            <?=$MSG_5059?>
            </TD>
    </TR>
</TABLE>
<!-- ## display messages ## -->
<?
    while($MSG = mysql_fetch_array($res_msgs))
    {
?>

<TABLE WIDTH="70%" BORDER="0" CELLSPACING="0" CELLPADDING="0" ALIGN="center">
    <TR>
            <TD WIDTH="79%" VALIGN="top" BGCOLOR=#ffffff>
            <BR /><?=nl2br(stripslashes($MSG[message]))?>
            </TD>
        </TR>
        <TR>

          <TD WIDTH="79%" VALIGN="top" align=right BGCOLOR=#eeeeee>
            <?
                if($MSG[username])
                {
            ?>
            <FONT SIZE=-2>
            <?=$MSG_5060?>
            &nbsp;<B>
            <?=$MSG[username]?>
            </B> -
            <?=FormatDate($MSG[msgdate])?>
            </FONT>
            <?
                }
                else
                {
            ?>
            <FONT SIZE=-2>
            <?=$MSG_5060?>
            &nbsp;<B>
            <?=$MSG_5061?>
            </B> -
            <?=FormatDate($MSG[msgdate])?>
            </FONT>
            <?
                }
            ?>
          </TD>
        </TR>
        <TR>
            <TD WIDTH="79%" VALIGN="top" ALIGN=CENTER BGCOLOR=#000000><IMG SRC="images/transp.gif" WIDTH="1" HEIGHT="1"></TD>
        </TR>
        <TR>
            <TD WIDTH="79%" VALIGN="top" ALIGN=CENTER BGCOLOR=#ffffff><IMG SRC="images/transp.gif" WIDTH="1" HEIGHT="5"></TD>
        </TR>
    </TABLE>
<?
    }
?>
<CENTER>

<?=$MSG_5246?>&nbsp;&nbsp;<?=$PAGE?> 
<?=$MSG_5247?>&nbsp;&nbsp;<?=$PAGES?>
<BR />
<?
    $PREV = intval($PAGE - 1);
    $NEXT = intval($PAGE  + 1);
?>

<?
    if($PAGES > 1)
    {
        if($PAGE > 1)
        {
?>
    <A HREF="<?=basename($_SERVER["PHP_SELF"])?>?id=<?=$id?>&PAGE=<?=$PREV?>"><U>&lt;&lt;Prev</U></a>
    &nbsp;&nbsp;
<?
        }
?>

<?
        $LOW = $PAGE - 5;
        if($LOW <= 0) $LOW = 1;
        $COUNTER = $LOW;
        while($COUNTER <= $PAGES && $COUNTER < ($PAGE+6))
        {
            if($PAGE == $COUNTER)
            {
                print "<B>$COUNTER</B>&nbsp;&nbsp;";
            }
            else
            {
                print "<A HREF=\"".basename($_SERVER["PHP_SELF"])."?id=$id&PAGE=$COUNTER\"><U>$COUNTER</U></A>&nbsp;&nbsp;";
            }
            $COUNTER++;
        }
?>
        &nbsp;&nbsp;
<?
    if($PAGE < $PAGES)
    {
?>
        <A HREF="<?=basename($_SERVER["PHP_SELF"])?>?id=<?=$id?>&PAGE=<?=$NEXT?>"><U>Next&gt;&gt;</U></A>

<?
    }
}

?>

</CENTER>
<BR />
</td>
</tr>
</table>
</FORM>